# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=py3-pyspinel
pkgver=1.0.3
pkgrel=1
pkgdesc="A Python interface to the OpenThread Network Co-Processor (NCP)"
url="https://github.com/openthread/openthread"
arch="noarch"
license="Apache-2.0"
depends="
	py3-pyserial
	python3
	"
makedepends="
	py3-gpep517
	py3-installer
	py3-setuptools
	py3-wheel
	"
subpackages="$pkgname-pyc"
source="https://pypi.python.org/packages/source/p/pyspinel/pyspinel-$pkgver.tar.gz"
options="!check" # Broken
builddir="$srcdir/pyspinel-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m unittest discover
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
e5b128680b846263924bd306d419917f3e3dc6b2052adfdf6931dd18f6d1ddb18be033880874b4404d79fa0910b64ece7d9fdbda5c7ab4aed759ef1fc9f0f1a7  pyspinel-1.0.3.tar.gz
"
